home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 3
/
DOS069.dsk
/
ROBOT BW.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
3KB
|
90 lines
1 HOME
2 PRINT : PRINT " ROBOT"
3 PRINT : PRINT "YOU ARE A SMALL TRADER SHIP"
4 PRINT "WHICH HAS BLUNDERED INTO A HIGH SECURITY";
5 PRINT "WEAPONS DUMP OF THE FEDERATION.": PRINT
6 PRINT "IN ORDER TO SURVIVE, YOU MUST AVOID"
7 PRINT "THE FOUR AUTOMATED SCANNERS (ARROWS)"
9 PRINT "WHILE TRYING TO MAKE THE 1 TO 6 KILLER"
10 DIM A$(9),A(22,12)
11 PRINT "ROBOT DOGS BLUNDER INTO EACH OTHER,": PRINT "STARS OR SCANNERS."
12 PRINT : PRINT "IF SUCCESSFUL, YOU'LL LIVE.": PRINT
16 PRINT "YOU MOVE BY TYPING A NUMBER (1-8)"
17 PRINT "WHICH INDICATES YOUR COURSE."
18 PRINT "1 IS EAST, 3 IS NORTH": PRINT "5 IS WEST AND 7 IS SOUTH.": PRINT
19 PRINT "YOU MAY USE 2,4,6,8 FOR": PRINT "INBETWEEN DIRECTIONS."
22 PRINT "TYPE GO AND PRESS RETURN TO PLAY";
25 INPUT A$
27 FOR J = 1 TO 22: FOR K = 1 TO 12:A(J,K) = 1: NEXT K: NEXT J
30 V = 0:R = 1
40 A$ = "X *OR>^<V"
50 FOR A = 2 TO 11: FOR B = 2 TO 21:C = RND(30) *100 +1:A(B,A) = 2: IF C >15 THEN 130
100 A(B,A) = 3
110 IF C >6.5 THEN 130
120 R = R +1:A(B,A) = 5
130 NEXT B : NEXT A
150 FOR A = 9 TO 4 STEP -1
160 X = INT( RND(21) *20 +1):Y = INT( RND(21) *10 +1)
180 IF A(X,Y) < >2 THEN 160
190 A(X,Y) = A: NEXT A
192 IF R >12 THEN PRINT "TOO ANY ROBOTS. ONE MOMENT PLEASE...": GOTO 27
195 HOME
220 Q9 = 35
225 POKE 36,9
227 POKE 37,5
229 PRINT CHR$(7)
230 FOR A = 1 TO 12
240 POKE 36,9
290 FOR B = 1 TO 22 :C = A(B,A): IF C <10 THEN 330
300 A(B,A) = A(B,A) -10:C = A(B,A)
330 PRINT MID$ (A$,C,1);
340 NEXT B: PRINT : NEXT A
350 CALL -958
370 PRINT "ROBOTS LEFT ";R;" ";"YOUR MOVE IS";
380 INPUT C
385 IF C = 999 THEN 950
390 IF C < > INT(C) OR C <0 OR C >8 THEN 370
400 IF C = 0 THEN 490
420 A(X,Y) = 12
430 X = X + INT( COS((C -1) *.785398) +.5) : Y = Y + INT( - SIN((C -1) *.785398) +.5)
450 IF A(X,Y) = 2 THEN 480
460 PRINT "YOU ARE DEAD. ": GOTO 950
480 A(X,Y) = 4
490 FOR A = 1 TO 12: FOR B = 1 TO 22
510 IF A(B,A) <6 OR A(B,A) >9 THEN 740
530 C = (A(B,A) -6) *2: V = B + INT( COS(C *.785398) +.5): Z = A + INT( - SIN(C *.785398) +.5): C = A(V,Z)
561 IF C < >12 THEN 565
562 A(V,Z) = 2
563 C = A(V,Z)
565 IF C = 1 THEN 700
570 IF C = 4 THEN 460
580 IF C <6 THEN 620
590 PRINT "SCANNER COLLISION ":A(V,Z) = 3: GOTO 680
620 IF C < >3 THEN 650
630 PRINT "SCANNER HITS STAR ": GOTO 680
650 IF C < >5 THEN 670
660 PRINT "SCANNER HITS ROBOT "
665 R = R -1
670 A(V,Z) = A(B,A) +10
680 A(B,A) = 12: GOTO 740
700 IF A(B,A) >7 THEN 730
710 A(B,A) = A(B,A) +2: GOTO 740
730 A(B,A) = A(B,A) -2
740 NEXT B: NEXT A
760 FOR A = 1 TO 12: FOR B = 1 TO 22
780 IF A(B,A) < >5 THEN 910
790 A(B,A) = 12
800 Z = A + SGN(Y -A): V = B + SGN(X -B)
820 IF A(V,Z) = 4 THEN 460
830 IF A(V,Z) < >3 THEN 860
840 PRINT "ROBOT HITS STAR<CTRL-G>":R = R -1: GOTO 910
860 IF A(V,Z) < >5 THEN 900
870 PRINT "ZAP! ZAP! <CTRL-G> ROBOT HITS ROBOT":R = R -2:A(V,Z) = 12
890 GOTO 910
900 C = 15:A(V,Z) = C
910 NEXT B: NEXT A
930 IF C = 15 THEN 220
940 PRINT "THEY'RE ALL DEAD. YOU WIN!"
950 PRINT "WANT TO PLAY AGAIN";: INPUT A$
960 IF LEFT$(A$,1) = "Y" THEN 27
970 END